var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, d, c) {
    if (im.getServerName().equals("BMS单机") && im.getServerName().equals("BMS至尊体验服") && !im.getServerName().equals("BMS至尊")) {
        im.playerMessage(1, " 使用环境异常，请还原服务端配置。");
        im.dispose();
        return
    }
    if (status == 0 && e == 0) {
        im.dispose();
        return
    }(e == 1) ? status++ : status--;
    selectionLog[status] = c;
    var b = -1;
    if (status <= b++) {
        im.dispose()
    } else {
        if (status === b++) {
            var f = im.getItemId();
            im.gainItem(f, -1);
            var a = [4230505, 4230506, 5120501, 2600321, 5120502];
            im.gainOneMobCollection(im.rand(a));
            im.dispose()
        }
    }
};